package com.example.market_management;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@SpringBootApplication
@EnableScheduling

public class MarketManagementApplication  {

    public static void main(String[] args) {
        SpringApplication.run(MarketManagementApplication.class, args);
    }
//    @Autowired
//    private com.example.market_management.mapper.secProductMapper secProductMapper;
//    @Autowired
//    private com.example.market_management.util.redisUtil redisUtil;
//
//    //初始化执行方法，将商品库存放到redis中
//    @Override
//    public void run(ApplicationArguments args) throws Exception {
//        QueryWrapper queryWrapper=new QueryWrapper();
//        List<SecProduct> secProductList=secProductMapper.selectList(queryWrapper);
//        System.out.println("执行初始化");
//        for(SecProduct secProduct:secProductList){
//            redisUtil.set(secProduct.getName(),secProduct.getNum());
//            System.out.println("产品数量:"+redisUtil.get(secProduct.getName()));
//        }
//    }
}
